package com.sinochem.yunlian.ship.common.enums;

import java.util.HashMap;

import lombok.Getter;

public enum FuelStatus {

	 SHELF(0 , "在售"),
	 DROP_OFF(1 , "已下架");

     @Getter
     private int typeCode;
	 @Getter
	 private String name;

	 FuelStatus(int typeCode, String name) {
		 
		 this.typeCode = typeCode;
	     this.name = name;
	 }

	
	/**
	 * 返回值
	 * @param code
	 * @return
	 */
	public static String returnMessage(Integer code) {
		
		if (code == null) {
			return null;
		}
		FuelStatus[] types = FuelStatus.class.getEnumConstants();
		HashMap<Integer, String> hashMap = new HashMap<>(10);
		
		for (int i = 0; i < types.length; i++) {
			hashMap.put(types[i].getTypeCode(), types[i].getName());
		}
		
		return hashMap.get(code);
	}
}
